package com.woniuxy.shop.service;

import java.util.List;

import com.woniuxy.shop.dao.RemarkDao;
import com.woniuxy.shop.entity.PageBean;
import com.woniuxy.shop.entity.Remark;
import com.woniuxy.shop.entity.User;

/**
*@author 作者：
*version 创建时间：
*类说明：
*/
public class RemarkService {
	RemarkDao rd = new RemarkDao();
	
	public PageBean<Remark> getPageBean(int page, Remark r){
		 PageBean<Remark> pb = new PageBean<>();
		 int totalNum = rd.getRemarkAsLimit(r);
		 List<Remark>  users = rd.getRemarkByPage(page, 2, r);
		 
		 pb.setList(users);
		 pb.setNowNum(users.size());
		 pb.setNowPage(page);
		 pb.setPageSize(1);
		 pb.setTotalPage(totalNum%2==0?totalNum/2:totalNum/2+1);
		 pb.setTotalNum(totalNum);
		 return pb;
	}
}
